// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1
import com.nokia.symbian 1.1
import com.nokia.extras 1.1
StatusBar {
    id: statusBar
    anchors.top: window.top
    property string titleName
    function loading(){
        busyindicator.opacity = 1
        icon.opacity = 0;
        busyindicator.running = true;
        console.debug("[MyStatusBar] Loading")
    }
    function finished(){
        busyindicator.opacity = 0
        busyindicator.running = false;
        icon.opacity = 1;
        console.debug("[MyStatusBar] Finished")
    }
    BusyIndicator{
        id:busyindicator
        width: 30
        anchors.top: parent.top
        anchors.topMargin: 0
        anchors.bottom: parent.bottom
        anchors.bottomMargin: 0
        anchors.left: parent.left
        anchors.leftMargin: 0
        opacity: 0
        Behavior on opacity { NumberAnimation { easing.type: Easing.InQuad; duration: 200 }}

    }
    Image {
        id: icon
        source: "qrc:/icon"
        anchors.top: parent.top
        anchors.topMargin: 0
        anchors.bottom: parent.bottom
        anchors.bottomMargin: 0
        anchors.left: parent.left
        anchors.leftMargin: 0
        fillMode: Image.PreserveAspectFit
        Behavior on opacity { NumberAnimation { easing.type: Easing.InQuad; duration: 200 }}
    }
    Text {
        id: title
        text: qsTr(titleName)
        color: "white"

        anchors.right: parent.right
        anchors.rightMargin: 0
        anchors.top: parent.top
        anchors.topMargin: 0
        anchors.bottom: parent.bottom
        anchors.bottomMargin: 0
        anchors.left: icon.right
        anchors.leftMargin: 0
    }
}
